package com.jxl.springboot.game.service;

import com.jxl.springboot.game.mapper.UserLoginRecordMapper;
import com.jxl.springboot.game.pojo.UserLoginRecord;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * 用户登录记录
 *
 * @author 江雪林
 * @create 2021-03-29
 */
@Service
public class UserLoginRecordService {
    @Autowired(required = false)
    private UserLoginRecordMapper userLoginRecordMapper;

    /**
     * 添加用户记录
     *
     * @param userLoginRecord
     * @return
     */
    public boolean addRecord(UserLoginRecord userLoginRecord) {
        if (userLoginRecord != null && userLoginRecord.getUserId() > 0) {
            return userLoginRecordMapper.addLoginRecord(userLoginRecord) > 0;
        }
        return false;
    }
}
